<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>

<h:body>
    <h:form id="jsfexample">

        <p:dataTable value="#{manager.cacheList}" var="item" id="mydata">
            <p:column>
                <f:facet name="header">Name</f:facet>
                <h:outputText value="#{item.name}" />
            </p:column>
            <p:column>
                <f:facet name="header">Surname</f:facet>
                <h:outputText value="#{item.surname}" />
            </p:column>
            <p:column>
                <f:facet name="header">Age</f:facet>
                <h:outputText value="#{item.age}" />
            </p:column>
            <p:column>
                <f:facet name="header">City</f:facet>
                <h:outputText value="#{item.city}" />
            </p:column>
        </p:dataTable>
        <p:panel header="Export All Data">
            <h:commandLink>
                <p:graphicImage value="/icons/excel.jpg" />
                <p:dataExporter type="xls" postProcessor="#{manager.postProcessXLS}"
                                target="mydata" fileName="myexcel" pageOnly="true" />
            </h:commandLink>
            <h:commandLink>
                <p:graphicImage value="/icons/pdf.png" />
                <p:dataExporter type="pdf" target="mydata" fileName="mypdf" pageOnly="true" />
            </h:commandLink>

            <h:commandLink>
                <p:graphicImage value="/icons/csv.jpg" />
                <p:dataExporter type="csv" target="mydata" fileName="mycsv" pageOnly="true" />
            </h:commandLink>

            <h:commandLink>
                <p:graphicImage value="/icons/xml.jpg" />
                <p:dataExporter type="xml" target="mydata" fileName="myxml" pageOnly="true" />
            </h:commandLink>
        </p:panel>

    </h:form>
</h:body>
</html>